﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Omega.Game.Framework
{
    abstract public  class SceneBase : Interfaces.IComponent , Interfaces.IRender
    {

        public List<Interfaces.IComponent> Objects;

        public Interfaces.IComponent Parent
        {
            get
            {
                return null;
            }
            set
            {
               
            }
        }

        public string Name
        {
            get
            {
                return "";
            }
            set
            {
             
            }
        }

       

        public  void Init()
        {
            Objects = new List<Interfaces.IComponent>();
        }

        public  void Update()
        {
            foreach (Interfaces.IComponent obj in Objects)
            {
                obj.Update();
            }
        }

        public  void Dispose()
        {
           
        }

        public bool NeedDraw
        {
            get
            {
                return this.Objects.Count > 0;
            }
            set
            {
              
            }
        }

        public bool Disposed
        {
            get
            {
                return false;
            }
            set
            {
               
            }
        }

      
        public void Draw()
        {
            if (!NeedDraw)
                return;

            foreach (Interfaces.IRender objectToRender in Objects)
            {
                if (objectToRender is Interfaces.IRender && objectToRender.NeedDraw)
                    objectToRender.Draw();
            }
        }


        public string Version
        {
            get
            {
                return "";
            }
            set
            {
              
            }
        }


        public void CreateRender()
        {
            throw new NotImplementedException();
        }

        internal void Load()
        {
            throw new NotImplementedException();
        }

        internal void Unload()
        {
            throw new NotImplementedException();
        }
    }
}
